﻿@using ECG.WebUI.CustomHelpers
@model ECG.WebUI.Models.OrderInfo

<div class="sp-wrap">
		<div class="sp-content">
			<div class="spc-tt">
				<span class="spc-icon-cart"></span>
				<span class="spc-icon-close"></span>
				<div class="spct-left">GIỎ HÀNG</div>
				<div class="spct-right">Có tất cả <strong>@Model.ProductOrderList.Count</strong> sản phẩm trong giỏ hàng của bạn</div>
				<div class="clr"></div>
			</div>
            <ul class="spc-con">
                @foreach(var item in Model.ProductOrderList)
                {
                    var imageLink = item.ProductImagePath.ImagePathThumb(188, 188);
                    <li>
					    <div class="fl-l">
						    <img src="@imageLink" alt="" width="125" height="124"/>
					    </div>
					    <div class="sp-item fl-l">
                            <p>
                                <a href="@Url.Action("Index","ProductDetail", new { productName = item.ProductName, productId = item.ProductId })" title="">@item.ProductName</a>
                            </p>
                            @if(!string.IsNullOrEmpty(item.ProviderName))
                            {
                                <p>
							        @item.ProviderName
						        </p>
                            }
						    <p>
							    Số lượng <input type="text" value="@item.ProductQuantity" style="width: 30px;"/>
						    </p>
						    <p>
							    Mã sản phẩm: 
							    <strong>@item.ProductBarcode</strong>
						    </p>
					    </div>
					    <div class="sp-item sp-item-last fl-l">
                            <span class="icon-spi-close"></span>
                            @{
                                var productStatus = string.Empty;
                                switch (item.ProductStatus)
                                {
                                    case "conhang":
                                        productStatus = "Còn hàng";
                                        break;
                                    case "goihang":
                                        productStatus = "Gọi hàng"; break;
                                    case "hethang":
                                        productStatus = "Hết hàng"; break;
                                    default:
                                        productStatus = "Còn hàng";
                                        break;
                                }
                            }
                            <p>
                                <span class="icon-spi-stock"></span>
                                @productStatus
                            </p>
                            @if(item.PromotionPrice > 0)
                            {
                                <p>
                                    <span class="icon-spi-save"></span>
                                    Tiết kiệm <span>@item.PromotionPercent %</span>
                                </p>
                                <p>
							        <span class="cl-red-bold">@item.PromotionPrice.ToString("#,###") <span>VNĐ</span></span>
						        </p>
                            }
						    else
                            {
                                <p>
							        <span class="cl-red-bold">@item.RootPriceProduct.ToString("#,###") <span>VNĐ</span></span>
						        </p>
                            }
						    <p>
							    <span class="icon-spi-tranform"></span>
							    Giao hàng tận nơi
						    </p>
					    </div>
					    <div class="clr"></div>
				    </li>
                }
			</ul>
			<div class="clr"></div>
			<div class="spc-foot">
				<div class="spcf-first fl-l">
					<span>Sử dụng phiếu giảm giá</span>
					<p><input type="text"/> <input type="button" value="SỬ DỤNG"/></p>
				</div>
				<div class="spcf-last fl-r">
					<span class="icon-spcf-arrowup"></span>
					<span class="icon-spcf-arrowdown"></span>
					<div>
						<span style="margin-top: 5px;display:block;">TỔNG CỘNG</span>
						<span class="spcf-price">@Model.TotalMoney.ToString("#,###") <span>VNĐ</span></span>
						<div><a href="@Url.Action("Index", "Order")">TIẾN HÀNH THANH TOÁN</a></div>
						<div class="clr"></div>
					</div>
					<div>
						<span>THÀNH TIỀN</span>
						<span class="spcf-price">@Model.TotalMoney.ToString("#,###") <span>VNĐ</span></span>
						<div class="spc-money-last"><a href="javascript:void(0);" class="shopCartContinue">TIẾN HÀNH MUA SẮM</a></div>
						<div class="clr"></div>
					</div>
				</div>
				<div class="clr"></div>
			</div>
		</div> <!-- END .sp-content -->
	</div> <!-- END .sp-wrap -->